<include file="Public:header" />

<script src="__JS__/ueditor/ueditor.config.js"></script>
<script src="__JS__/ueditor/ueditor.all.js"></script>
<!-- main content start-->
<div class="main-content" >

<!-- header section start-->
<div class="header-section">

    <!--toggle button start-->
    <a class="toggle-btn"><i class="fa fa-bars"></i></a>
    <!--toggle button end-->
    <!--notification menu start -->
    <div class="menu-right">
        <ul class="notification-menu" style="margin-top: 15px;">
            <li>
                <span class="span" style="margin-top: 100px;"><!-- data-toggle="dropdown"-->
                    账户余额(元)<span style="color: red; font-size: 16px; font-weight: 800 ">{$shopinfo.money}</span>
                </span>
            </li>
        </ul>
    </div>
    <!--notification menu end -->

</div>
<!-- header section end-->
<!-- page heading start-->
<div class="page-heading">
    <h3>
        商户管理
    </h3>
    <ul class="breadcrumb">
        <li>
            <a href="#">首页</a>
        </li>
        <li> 商户管理 </li>
        <li class="active"> 修改商户信息 </li>
    </ul>
</div>
<!-- page heading end-->
<!--body wrapper start-->
<div class="wrapper">
    <section class="panel">
        <header class="panel-heading">
            修改商户信息
        </header>
        <div class="panel-body">
            <form class="form-horizontal" enctype="multipart/form-data" method="post" >
                <input type="hidden" name="id" id="id" value="{$info.id}">
                <div class="form-group">
                    <label class="col-md-2 col-sm-2 control-label">标题</label>
                    <div class="col-md-6 col-sm-6">
                        <input type="text" name="title" id="title" class="form-control" placeholder="二维码标题" value="{$info.title}">
                    </div>
                </div>
                <div class="form-group" style="height: 300px;">
                    <label class="col-md-2 col-sm-2 control-label">活动说明</label>
                    <div class="col-md-6 col-sm-6">
                        <textarea id="content" name="content"   type="text/plain " value="">{$info.content}</textarea>
                        <script>
                            var ue = UE.getEditor('content');

                        </script>
                    </div>
                </div>
                <div class="form-group" style="margin-top: 10px;">
                    <label class="col-md-2 col-sm-2 control-label">活动限额</label>
                    <div class="col-md-6 col-sm-6">
                        <input type="text" name="quota_money" id="quota_money" class="form-control" placeholder="活动限额" value="{$info.quota_money}">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 col-sm-2 control-label">最小红包金额</label>
                    <div class="col-md-6 col-sm-6">
                        <input type="text" name="money" id="money" class="form-control" placeholder="最小红包金额"  value="{$info.money}">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 col-sm-2 control-label">最大红包金额</label>
                    <div class="col-md-6 col-sm-6">
                        <input type="text" name="max_money" id="max_money" class="form-control" placeholder="最大红包金额" value="{$info.max_money}">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 col-sm-2 control-label">图片</label>
                    <div class="col-md-6 col-sm-6">
                        <input type="file" name="image" id="image" class="form-control">
                    </div>
                </div>
                </div>
                <div class="form-group">
                    <div class="col-lg-offset-2 col-md-6 col-sm-6">
                        <button type="submit" class="btn btn-primary" onclick="return checkout()">确认修改</button>
                        <button type="button" class="btn btn-primary" onclick="history.go(-1)">返回</button>
                    </div>
                </div>
            </form>
        </div>
    </section>

</div>
<!--body wrapper end-->
<!-- main content end-->
    <script>
        function open(){
            $("#addgoodsinfo").style("display","block");
        }
        function close(){
            $("#addgoodsinfo").style("display","none");

        }
        function checkout(){
            if($("#title").val()==""){
                toast("标题不得为空",false);
                return false;
            }
            var content=ue.getContent();
            if(content=="")
            {
                toast("说明不得为空",false);
                return false;
            }
            if($("#money").val()==""|| $("#money").val()<=0){
                toast("二维码金额不得为空且钱数不能小于0",false);
                return false;
            }
            if($("#quota_money").val()==""|| $("#quota_money").val()<=0){
                toast("活动限额不得为空且不能小于0",false);
                return false;
            }
            if($("#image").val()=="") {
                toast("请上传图片", false);
                return false;
            }
        }
    </script>
<include file="Public:footer" />